<?php
//   "D:\workspace 空格\amaz_spider\WpfApplication1\php5.3.10\php.exe"  -c "D:\workspace 空格\amaz_spider\WpfApplication1\php5.3.10\php.ini"  -f "D:\workspace 空格\amaz_spider\WpfApplication1\com.attilax/api.php" "$method="
$vars_list= array();
define('InShopNC','yes') ;
//$config['db'][1]['dbhost']  	= 'localhost';
//$config['db'][1]['dbport']		= '3306';
//$config['db'][1]['dbuser']  	= 'root';
//$config['db'][1]['dbpwd'] 	 	= '';
require_once(dirname(__FILE__).'/config.php');
$hostP7=$databaselocation;
$uP7=$databaseuser;
$pwdP7=$databasepass ;
$dbP7="shopedb" ;
//连接MySQL数据库
$conn=mysql_connect($hostP7, $uP7, $pwdP7."",true);   
 $GLOBALS["varsx"]["conn"]=$conn;
header("Content-Type: text/html; charset=utf-8");
//print_r("msqle:".mysql_error());
//print_r("conn:".$conn);
if(!$conn)
throw new Exception("err_login:登录数据错误！"); 
//throw "err:".mysql_error();  Can only throw objects in
/*if(mysql_error())   jeig dwei conn err cant take eff. if conn is err ,yet empty .only warning php has can see.
throw mysql_error();*/
//print_r($conn);
//选择当前数据库
//等效为执行USE test
mysql_select_db($dbP7."",$conn);
//print_r("msqle2:".mysql_error());

if(mysql_error($conn))
	throw new Exception(mysql_error($conn)); 
//在当前数据库执行SQL语句
mysql_query("set names 'utf8'");
if(mysql_error($conn))
	throw new Exception(mysql_error($conn)); 

?>


<?php
/*$query = "SELECT * FROM snc_store";
$result = mysql_query($query,$conn);
$vars_list["result"]=$result;

$row_nums=  mysql_num_rows( $result ) ;
$vars_list["row_nums"]=$row_nums;
print_r($vars_list);
if(!$row_nums)
	return;
 
//操作上次查询返回的结果集，注意$result变量一般是需要的
while($student = mysql_fetch_array($result)) {
		echo '<pre>';
		print_r($student);
		echo '</pre>';
}
*/
?>